Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing exports for subpath module #2268

Closed
wants to merge 1 commit into from

Conversation

khmm12
Copy link
Contributor

@khmm12 khmm12 commented Aug 31, 2023

Subpath exports should be defined via package.json exports field for ESM.

It's still not ESM compliant, because inside CJS packages ESM modules should have extension .mjs and all their imports should be fully specified import './events.mjs', not import './events'.

Subpath exports should be defined via package.json exports field for ESM
@tordans
Copy link
Contributor

tordans commented Sep 4, 2023

@khmm12 I just created #2272 to give this a bit more visibility and document my failed attempts at workarounds. Did you get this working for you?

@khmm12
Copy link
Contributor Author

khmm12 commented Sep 5, 2023

@tordans Yes, it works well with bundlers like webpack. But as I mentioned in the description the package is still not ESM compliant, therefore it's not compatible with strict environments like node.js. The next step should be ESM compliant package.

@tordans
Copy link
Contributor

tordans commented Sep 6, 2023

@khmm12 do you have experience with how to best do this? I am just reading about https://deno.com/blog/publish-esm-cjs-module-dnt which sounds nice but is based on Deno as an entry point…

@Pessimistress
Copy link
Collaborator

Closing in favor of #2281

@khmm12 khmm12 deleted the fix/package-exports branch February 13, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants